package cn.emall.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author Allen_HJL
 * @version 1.0
 * @date 2020/9/13 20:00
 */
@Data
@TableName("ws_cart")
public class Cart {

    @TableId(type= IdType.AUTO)
    private int id;

    private int userId;
    private int productId;
    private int quantity;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String productName;

    @TableField(exist = false)
    private String productSubTitle;

    @TableField(exist = false)
    private String productMain_image;

    @TableField(exist = false)
    private String productDetail;

    @TableField(exist = false)
    private Double productPrice;

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", userId=" + userId +
                ", productId=" + productId +
                ", quantity=" + quantity +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
